<!--
  ~ /*
  ~  *    Copyright 2020-2021 luter.me
  ~  *
  ~  *    Licensed under the Apache License, Version 2.0 (the "License");
  ~  *    you may not use this file except in compliance with the License.
  ~  *    You may obtain a copy of the License at
  ~  *
  ~  *      http://www.apache.org/licenses/LICENSE-2.0
  ~  *
  ~  *    Unless required by applicable law or agreed to in writing, software
  ~  *    distributed under the License is distributed on an "AS IS" BASIS,
  ~  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~  *    See the License for the specific language governing permissions and
  ~  *    limitations under the License.
  ~  */
  -->

<!DOCTYPE html>
<html lang="zh-CN" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      layout:decorate="~{pages/tpl/layout.html}">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
</head>
<body>
<section layout:fragment="content">
    <div class="container" th:with="token=${token}">
        <div th:if="${token!=null}">
            <p>token Id:<span th:text="${token.id}"></span></p>
            <p>token iat:<span th:text="${token.iat}"></span></p>
            <p>token iat:<span th:text="${#dates.format(new java.util.Date(token.iat), 'yyyy-MM-dd HH:mm:ss')}"></span>
            </p>
            <p>token exp:<span th:text="${#dates.format(new java.util.Date(token.exp), 'yyyy-MM-dd HH:mm:ss')}"></span>
            </p>
            <p>token isExpired:<span th:text="${token.hasExpired()?'YES':'NO'}"></span></p>
            <hr>
            <div th:with="user=${token.getDetails()}">
                <h2 th:if="${user!=null}">
                    <p>Username <span th:text="${user.appId}"></span></p>
                    <p>Username <span th:text="${user.attributes.get('username')}"></span></p>
                    <p>UserId <span th:text="${user.attributes.get('id')}"></span></p>
                    <p>Cell Phone <span th:text="${user.attributes.get('mobile')}"></span></p>
                </h2>
            </div>
        </div>
        <div th:if="${null==token}">没登录啊</div>
    </div>
</section>


</body>
</html>